#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int i, j, myrank, size;
	MPI_Init(&argc, &argv);

	MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
	MPI_Comm_size(MPI_COMM_WORLD, &size);
	MPI_Status status;
	MPI_File fh;
	int * buf = (int*) malloc(sizeof(int) * 4);
	MPI_File_open(MPI_COMM_WORLD, (char*) "dcsc_mat.bin",
			MPI_MODE_RDONLY , MPI_INFO_NULL, &fh);

	MPI_File_read(fh, buf, 4, MPI_INT, &status);

	printf("Rank=%d: (%d,%d,%d,%d)", myrank, buf[0], buf[1], buf[2], buf[3]);
	free(buf);
	MPI_File_close(&fh);
	MPI_Finalize();
	return 0;
}
